package com.atguigu.auth.activiti;

import org.activiti.engine.delegate.DelegateTask;
import org.activiti.engine.delegate.TaskListener;

/**
 * className: MyTaskListener
 * description:
 * date: 2023/4/19 0019-23:44
 * <p>
 * project: guigu-oa-parent
 * package: com.atguigu.auth.activiti
 * email: 1085844536@qq.com
 * version:
 *
 * @author WangGuojian
 */
public class MyTaskListener implements TaskListener {

    @Override
    public void notify(DelegateTask task) {
        if (task.getName().equals("经理审批")) {
            // 分配任务
            task.setAssignee("jack");
        } else if (task.getName().equals("人事审批")) {
            task.setAssignee("tom");
        }
    }
}
